﻿using System.Web;
using AmazeUI.db;
using AmazeUI.Imodel;

namespace Ema.Models
{
    public class XtCom
    {
        public static ILoginModel LoginModel
        {
            get
            {
                var model = (ILoginModel)HttpContext.Current.Session["user"];
                if (model == null)
                {
                    var xtUser = new XtUser { Id = 0 };
                    HttpContext.Current.Session["user"] = xtUser;
                    return xtUser;
                }
                return model;
            }
            set
            {
                HttpContext.Current.Session["user"] = value;
                HttpContext.Current.Session.Timeout = 300;
            }
        }
    }
}